package org.iabako.shared.iservice.business;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import org.iabako.shared.entity.business.BusinessEntity;
import org.iabako.shared.entity.business.Tracking;
import org.iabako.shared.entity.business.TrackingObject;
import org.iabako.shared.entity.enumeration.TrackingType;

import java.util.List;

/**
 * Created by jose on 04/05/15.
 */
public interface TrackingServiceAsync {

    void getTodayTracking(AsyncCallback<List<Tracking>> async);

    void addTrackingToUserSession(TrackingType trackingType, BusinessEntity trackingObject, AsyncCallback<Void> async);

    void addTrackingToUserSession(TrackingType trackingType, BusinessEntity trackingObject, int cardinalNumber, String comment, AsyncCallback<Void> async);

    void getTrackingObjects(Tracking tracking, AsyncCallback<List<TrackingObject>> async);

    public static final class Util {
        private static TrackingServiceAsync instance;

        public static final TrackingServiceAsync getInstance() {
            if (instance == null) {
                instance = GWT.create(TrackingService.class);
            }
            return instance;
        }
    }
}
